-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
System version doesn't need to match when assigning a code #1317
System version doesn't need to match when assigning a code #1317
Conversation
A code assigned with a system may include a version as part of the system. This is generally intended to refer to the system's published version in the world, and is not guaranteed to match the version of the CodeSystem FHIR resource. Fish for any version when resolving the system, and do not emit a warning even if the versions don't match.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good. I just have one suggestion that I think is right, but want @jafeltra to confirm.
src/fhirtypes/common.ts
Outdated
@@ -952,9 +952,12 @@ export function replaceReferences<T extends AssignmentRule | CaretValueRule>( | |||
} | |||
} | |||
} else if (value instanceof FshCode) { | |||
// the version on a CodeSystem resource is not the same as the system's actual version out in the world. | |||
// so, they don't need to match. | |||
const baseSystem = value.system?.split('|')[0]; | |||
const codeSystemMeta = fishForMetadataBestVersion( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we're removing the version, I think this can just be fishForMetadata
now, right @jafeltra?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep! For simplicity, fishForMetadata
should be sufficient. Looking at the implementation of fishForMetadata
, if there is no |
in the the value passed in, it actually doesn't make any difference and will only try to call fishForMetadata
. But based on how we've used these functions, we've only been using fishForBestMetadata
in the cases where we want the version match or the next best thing.
I didn't notice anything else, besides the small change @cmoesel suggested. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me!
Fixes #1305 and completes task CIMPL-1147.
A code assigned with a system may include a version as part of the system. This is generally intended to refer to the system's published version in the world, and is not guaranteed to match the version of the CodeSystem FHIR resource. Fish for any version when resolving the system, and do not emit a warning even if the versions don't match.